cuda.core: expose last prefetch location on ManagedBuffer - #2774
Conversation
|
/ok to test |
@isVoid, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/1/ |
|
/ok to test 08b4cf4 |
| from cuda.core._utils.version import binding_version, driver_version | ||
|
|
||
| if binding_version() < (13, 0, 0) or driver_version() < (13, 0, 0): | ||
| pytest.skip("Host NUMA last-prefetch location requires CUDA 13") |
There was a problem hiding this comment.
I've been trained to lean towards skipping at collection time. Worth doing here?
There was a problem hiding this comment.
Not sure if there are any order requirement at test collecting time and initializing CUDA. Let me check with my agent to see if possible.
brandon-b-miller
left a comment
There was a problem hiding this comment.
Overall looks good. Based on what happened when this features sibling attrs were introduced, I infer that we may need a release notes entry documenting this new feature.
| if loc_type == <int>cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT: | ||
| return Host.numa_current() | ||
| return None # CU_MEM_LOCATION_TYPE_INVALID — no preferred location | ||
| return None # CU_MEM_LOCATION_TYPE_INVALID |
There was a problem hiding this comment.
the docs for LAST_PREFETCH_LOCATION_TYPE list only DEVICE, HOST, HOST_NUMA, and INVALID is the HOST_NUMA_CURRENT branch reachable in practice, or should a numa_current() prefetch be documented as reading back the resolved node?
There was a problem hiding this comment.
and INVALID is the HOST_NUMA_CURRENT branch reachable in practice
Not sure if this is accurate - I think this branch, according to the documentation, is unreachable at all times. IMO the branch should just be
if loc_type == <int>cydriver.CUmemLocationType.CU_MEM_LOCATION_TYPE_INVALID:
return None
# raise? Fall through?
Small self nit: the _HOST branch can also skip querying the id and return sooner to avoid an additional API query.
There was a problem hiding this comment.
Correction: It seems like the doc is inconsistent - After runtime probing, the return type can be HOST_NUMA_CURRENT if the previously prefetched mem location is HOST_NUMA_CURRENT. So we should add INVALID branch and document numa_current.
|
/ok to test afb0334 |
|
/ok to test bcf63da |
|
Description
closes #2109
Expose the read-only
ManagedBuffer.last_prefetch_locationproperty.Device,Host, orNone.LAST_PREFETCH_LOCATION_TYPE/_IDpair so NUMA host locations round-trip.Testing
cd cuda_core && pixi run -e cu13 pytest tests/memory/test_managed_ops.py -q— 37 passed, 1 skippedcd cuda_core && pixi run -e cu12 pytest tests/memory/test_managed_ops.py -q— 16 passed, 22 skippedChecklist